import 'package:kmxy_base_example/page/page_manage_package.dart';
import 'package:kmxy_base/base/base_package.dart';

abstract class TablePageState extends BasePageState<TablePage> {
  List dataList = [
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
  ];
  @override
  initData() {}

  @override
  destroyData() {}

  late TableViewController tableViewController;

  onTableViewCreated(TableViewController controller) {
    tableViewController = controller;
    // onRefresh();
  }

  onRefresh() async {
    setState(() {
      dataList = [
        {},
        {},
        {},
      ];
    });
    tableViewController.onFinishRefresh();
  }

  onLoading() async {
    setState(() {
      dataList.addAll([
        {},
        {},
        {},
      ]);
    });
    tableViewController.onFinishLoading(false);
  }
}
